From 3629e4dea0094db5500bb93780269fb7f5e89491 Mon Sep 17 00:00:00 2001 From: Jimi Xenidis Date: Sat, 2 Jun 2007 22:01:45 -0400 Subject: [PATCH] [POWERPC][XEN] Build firmware as single section and also build a debuggable image. - Uses --omagic to make sure that firmware is a singel image - Link and extra firmware image that is starts where we expect to load, this allows gdb to work on the image. Signed-off-by: Jimi Xenidis --- xen/arch/powerpc/Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xen/arch/powerpc/Makefile b/xen/arch/powerpc/Makefile index f20580f6ce..0461353707 100644 --- a/xen/arch/powerpc/Makefile +++ b/xen/arch/powerpc/Makefile @@ -63,12 +63,19 @@ CFLAGS += $(PPC_C_WARNINGS) # objects into a single ELF segment and to not link in any additional # objects that gcc would normally like to # -OMAGIC = -nodefaultlibs -nostartfiles +OMAGIC = -nodefaultlibs -nostartfiles -Wl,--omagic firmware: of_handler/built_in.o $(TARGET_SUBARCH)/memcpy.o of-devtree.o $(CC) $(CFLAGS) $(OMAGIC) -e __ofh_start -Wl,-Ttext,0x0 $^ -o $@ -firmware_image.bin: firmware +# +# Link firmware again but this time at the place we expect to load it. +# This makes debugging _way_ easier. +# +firmware.dbg: of_handler/built_in.o $(TARGET_SUBARCH)/memcpy.o of-devtree.o + $(CC) $(CFLAGS) $(OMAGIC) -e __ofh_start -Wl,-Ttext,0x2000000 $^ -o $@ + +firmware_image.bin: firmware firmware.dbg $(CROSS_COMPILE)objcopy --output-target=binary $< $@ # @@ -139,5 +146,6 @@ dom0.bin: $(DOM0_IMAGE) clean:: $(MAKE) -f $(BASEDIR)/Rules.mk -C of_handler clean - rm -f firmware firmware_image.bin dom0.bin .xen-syms xen-syms.S \ + rm -f firmware firmware.dbg firmware_image.bin \ + dom0.bin .xen-syms xen-syms.S \ xen.lds asm-offsets.s cmdline.dep -- 2.30.2